package com.xyyhome.web.love.domain;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by ty850 on 2017/5/21.
 */
@Entity
@Table(name = "y_l_pandect", schema = "xyyhome", catalog = "")
public class YLPandect {
    private String ylpId;
    private Timestamp ylpCreateTime;
    private Timestamp ylpEndTime;
    private Byte ylpState;
    private String ylpLestId;

    @Id
    @Column(name = "ylp_id", nullable = false, length = 36)
    public String getYlpId() {
        return ylpId;
    }

    public void setYlpId(String ylpId) {
        this.ylpId = ylpId;
    }

    @Basic
    @Column(name = "ylp_create_time", nullable = true)
    public Timestamp getYlpCreateTime() {
        return ylpCreateTime;
    }

    public void setYlpCreateTime(Timestamp ylpCreateTime) {
        this.ylpCreateTime = ylpCreateTime;
    }

    @Basic
    @Column(name = "ylp_end_time", nullable = true)
    public Timestamp getYlpEndTime() {
        return ylpEndTime;
    }

    public void setYlpEndTime(Timestamp ylpEndTime) {
        this.ylpEndTime = ylpEndTime;
    }

    @Basic
    @Column(name = "ylp_state", nullable = true)
    public Byte getYlpState() {
        return ylpState;
    }

    public void setYlpState(Byte ylpState) {
        this.ylpState = ylpState;
    }

    @Basic
    @Column(name = "ylp_lest_id", nullable = true, length = 36)
    public String getYlpLestId() {
        return ylpLestId;
    }

    public void setYlpLestId(String ylpLestId) {
        this.ylpLestId = ylpLestId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        YLPandect ylPandect = (YLPandect) o;

        if (ylpId != null ? !ylpId.equals(ylPandect.ylpId) : ylPandect.ylpId != null) return false;
        if (ylpCreateTime != null ? !ylpCreateTime.equals(ylPandect.ylpCreateTime) : ylPandect.ylpCreateTime != null)
            return false;
        if (ylpEndTime != null ? !ylpEndTime.equals(ylPandect.ylpEndTime) : ylPandect.ylpEndTime != null) return false;
        if (ylpState != null ? !ylpState.equals(ylPandect.ylpState) : ylPandect.ylpState != null) return false;
        if (ylpLestId != null ? !ylpLestId.equals(ylPandect.ylpLestId) : ylPandect.ylpLestId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = ylpId != null ? ylpId.hashCode() : 0;
        result = 31 * result + (ylpCreateTime != null ? ylpCreateTime.hashCode() : 0);
        result = 31 * result + (ylpEndTime != null ? ylpEndTime.hashCode() : 0);
        result = 31 * result + (ylpState != null ? ylpState.hashCode() : 0);
        result = 31 * result + (ylpLestId != null ? ylpLestId.hashCode() : 0);
        return result;
    }
}
